import mongoose from 'mongoose'

const Schema = mongoose.Schema;

const userSchema = new Schema({
  username: {
    type: String,
    unique: true
  },
  password: {
    type: String,
  },
  sex: {
    type: Number,
    default: 0,
  }, // 性别 0-男  1-女
  avatar: {     //头像
    type: String,
    default: 'default.jpeg'
  },
  address: {
    type: String,
    default: '中国'
  }, //地区
  sign: {
    type: String,
    default: '这个人还没有签名'
  }, //签名
  letter: {
    type: String,
  },
  meta: {
    createAt: {
      type: Date,
      default: Date.now()
    },
    updateAt: {
      type: Date,
      default: Date.now()
    }
  }
})



const User = mongoose.model('User', userSchema);

export default User
